﻿@{
    ViewBag.Title = Resources.Register;
    Layout = "~/Views/Shared/_Root.cshtml";
}
<div class="logon-container">
    <h1>
        <span class="log-in">@Resources.CreateAccount</span></h1>
    <div class="logon">
        @using (Html.BeginForm())
        {
            <p>
                <label for="username">
                    @Resources.Username</label>
                @Html.TextBox("username", null, new { @class = "textfield" })
                @Html.ValidationMessage("username")
            </p>
            <p>
                <label for="email">
                    @Resources.Email</label>
                @Html.TextBox("email", null, new { @class = "textfield" })
                @Html.ValidationMessage("email")
            </p>
            <p>
                <label for="password">
                    @string.Format("{0} ({1})", Resources.Password, System.String.Format(Resources.PasswordLimitation, ViewData["PasswordLength"]))
                </label>
                @Html.Password("password", null, new { @class = "textfield" })
                @Html.ValidationMessage("password")
            </p>
            <p>
                <label for="confirmPassword">
                    @Resources.ConfirmPassword</label>
                @Html.Password("confirmPassword", null, new { @class = "textfield" })
                @Html.ValidationMessage("confirmPassword")
            </p>
            <p class="clearfix">
                <input type="submit" value="@Resources.Register" />
            </p>
        }
    </div>
</div>
<script type="text/javascript">
//    Sys.require(["jquery.validate.unobtrusive", "MicrosoftMvcAjax", "jquery.unobtrusive-ajax"]);

//    function onFormCompleted(result) {
//        if (result.responseText.indexOf('DOCTYPE') > 0) {
//            $('.logon-container').html(result.responseText);
//        }
//        else {
//            var value = JSON.parse(result.responseText);
//            if (!!value && value.Status == "authenticated") {
//                window.parent.$.colorbox.close();
//                window.parent.location.reload();
//            }
//        }
//    }
</script>
